﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Decav.Financial
{
    /// <summary>
    /// Represents the currency of <see cref="Money"/>.
    /// </summary>
    [Serializable]
    public struct MoneyCurrency
    {
        static MoneyCurrency()
        {
            InitDictionaries();
        }

        private MoneyCurrency(int isoCode, string isoCharCode, string name)
            : this( isoCode, isoCharCode, name, isoCharCode )
        {
        }

        private MoneyCurrency(int isoCode, string isoCharCode, string name, string symbol)
        {
            if (name == null)
                throw new ArgumentNullException("name");

            if (isoCharCode == null)
                throw new ArgumentNullException("isoCharCode");

            if (symbol == null)
                throw new ArgumentNullException("symbol");
        

            _intIsoCode = isoCode;
            _threeLetterIsoName = isoCharCode;
            _symbol = symbol;
            _name = name;
        }

        /// <summary>
        /// The empty value of a <see cref="MoneyCurrency"/>.
        /// </summary>
        public static readonly MoneyCurrency Empty = new MoneyCurrency();

        #region Fields
        private string _threeLetterIsoName;

        private int _intIsoCode;

        private string _symbol;

        private string _name;

        #endregion

        #region Comparison

        public override int GetHashCode()
        {
            return _intIsoCode.GetHashCode();
        }


        /// <summary>
        /// Compares the equality of two <see cref="MoneyCurrency"/> against eachother.
        /// </summary>
        /// <param name="obj">The object to compare.</param>
        /// <returns>True if they are equal, false if they are inequal.</returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
                return false;

            if (obj.GetType() != typeof(MoneyCurrency))
                return false;

            MoneyCurrency cur = (MoneyCurrency)obj;
            return (cur._intIsoCode == this._intIsoCode);
        }

        #endregion

        /// <summary>
        /// Gets the english name of the currency.
        /// </summary>
        public string EnglishName
        {
            get
            {
                return _name;
            }
        }

        /// <summary>
        /// Gets the prefixing symbol of the currency.
        /// </summary>
        public string Symbol
        {
            get
            {
                return _symbol;
            }
        }

        /// <summary>
        /// Gets the ISO standard three-letter name.
        /// </summary>
        public string ThreeLetterIsoName
        {
            get
            {
                return _threeLetterIsoName;
            }
        }

        /// <summary>
        /// Gets the integer-based ISO code.
        /// </summary>
        public int NumberIsoCode
        {
            get
            {
                return _intIsoCode;
            }
        }

        /// <summary>
        /// Gets the prefixing symbol of the <see cref="MoneyCurrency"/>.
        /// </summary>
        /// <returns>The <see cref="Symbol"/> of the currency.</returns>
        public override string ToString()
        {
            return string.Format("{0} ({1})", this.ThreeLetterIsoName, EnglishName);
        }

        public static bool operator ==(MoneyCurrency left, MoneyCurrency right)
        {
            return left.Equals(right);
        }

        public static bool operator !=(MoneyCurrency left, MoneyCurrency right)
        {
            return !left.Equals(right);
        }

        /// <summary>
        /// The <see cref="MoneyCurrency"/> keyed by their ISO integer values.
        /// </summary>
        private static readonly Dictionary<int, MoneyCurrency> _isoIntKeyed = new Dictionary<int,MoneyCurrency>();

        /// <summary>
        /// The <see cref="MoneyCurrency"/> keyted by their ISO three-letter values.
        /// </summary>
        private static readonly Dictionary<string, MoneyCurrency> _isoThreeLetterKeyed = new Dictionary<string,MoneyCurrency>();

        #region Currencies
        private static void InitDictionaries()
        {
            #region Ints
            _isoIntKeyed.Add( 784, UnitedArabEmiratesDirham );
            _isoIntKeyed.Add( 971, Afghani );
            _isoIntKeyed.Add( 8, Lek );
            _isoIntKeyed.Add( 51, ArmenianDram );
            _isoIntKeyed.Add( 532, NetherlandsAntillianGuilder );
            _isoIntKeyed.Add( 973, Kwanza );
            _isoIntKeyed.Add( 32, ArgentinePeso );
            _isoIntKeyed.Add( 36, AustralianDollar );
            _isoIntKeyed.Add( 533, ArubanGuilder );
            _isoIntKeyed.Add( 944, AzerbaijanianManat );
            _isoIntKeyed.Add( 977, ConvertibleMarks );
            _isoIntKeyed.Add( 52, BarbadosDollar );
            _isoIntKeyed.Add( 50, Taka );
            _isoIntKeyed.Add( 975, BulgarianLev );
            _isoIntKeyed.Add( 48, BahrainiDinar );
            _isoIntKeyed.Add( 108, BurundianFranc );
            _isoIntKeyed.Add( 60, BermudianDollar );
            _isoIntKeyed.Add( 96, BruneiDollar );
            _isoIntKeyed.Add( 68, Boliviano );
            _isoIntKeyed.Add( 984, BolivianMvdol );
            _isoIntKeyed.Add( 986, BrazilianReal );
            _isoIntKeyed.Add( 44, BahamianDollar );
            _isoIntKeyed.Add( 64, Ngultrum );
            _isoIntKeyed.Add( 72, Pula );
            _isoIntKeyed.Add( 974, BelarussianRuble );
            _isoIntKeyed.Add( 84, BelizeDollar );
            _isoIntKeyed.Add( 124, CanadianDollar );
            _isoIntKeyed.Add( 976, FrancCongolais );
            _isoIntKeyed.Add( 947, WIREuro );
            _isoIntKeyed.Add( 756, SwissFranc );
            _isoIntKeyed.Add( 948, WIRFranc );
            _isoIntKeyed.Add( 990, Unidadesdeformento );
            _isoIntKeyed.Add( 152, ChileanPeso );
            _isoIntKeyed.Add( 156, YuanRenminbi );
            _isoIntKeyed.Add( 170, ColombianPeso );
            _isoIntKeyed.Add( 970, UnidaddeValorReal );
            _isoIntKeyed.Add( 188, CostaRicanColon );
            _isoIntKeyed.Add( 891, SerbianDinar );
            _isoIntKeyed.Add( 192, CubanPeso );
            _isoIntKeyed.Add( 132, CapeVerdeEscudo );
            _isoIntKeyed.Add( 196, CyprusPound );
            _isoIntKeyed.Add( 203, CzechKoruna );
            _isoIntKeyed.Add( 262, DjiboutiFranc );
            _isoIntKeyed.Add( 208, DanishKrone );
            _isoIntKeyed.Add( 214, DominicanPeso );
            _isoIntKeyed.Add( 12, AlgerianDinar );
            _isoIntKeyed.Add( 233, Kroon );
            _isoIntKeyed.Add( 818, EgyptianPound );
            _isoIntKeyed.Add( 232, Nakfa );
            _isoIntKeyed.Add( 230, EthiopianBirr );
            _isoIntKeyed.Add( 978, Euro );
            _isoIntKeyed.Add( 242, FijiDollar );
            _isoIntKeyed.Add( 238, FalklandIslandsPound );
            _isoIntKeyed.Add( 826, PoundSterling );
            _isoIntKeyed.Add( 981, Lari );
            _isoIntKeyed.Add( 288, Cedi );
            _isoIntKeyed.Add( 292, Gibraltarpound );
            _isoIntKeyed.Add( 270, Dalasi );
            _isoIntKeyed.Add( 324, GuineaFranc );
            _isoIntKeyed.Add( 320, Quetzal );
            _isoIntKeyed.Add( 328, GuyanaDollar );
            _isoIntKeyed.Add( 344, HongKongDollar );
            _isoIntKeyed.Add( 340, Lempira );
            _isoIntKeyed.Add( 191, CroatianKuna );
            _isoIntKeyed.Add( 332, HaitiGourde );
            _isoIntKeyed.Add( 348, Forint );
            _isoIntKeyed.Add( 360, Rupiah );
            _isoIntKeyed.Add( 376, NewIsraeliShekel );
            _isoIntKeyed.Add( 356, IndianRupee );
            _isoIntKeyed.Add( 368, IraqiDinar );
            _isoIntKeyed.Add( 364, IranianRial );
            _isoIntKeyed.Add( 352, IcelandKrona );
            _isoIntKeyed.Add( 388, JamaicanDollar );
            _isoIntKeyed.Add( 400, JordanianDinar );
            _isoIntKeyed.Add( 392, Japaneseyen );
            _isoIntKeyed.Add( 404, KenyanShilling );
            _isoIntKeyed.Add( 417, Som );
            _isoIntKeyed.Add( 116, Riel );
            _isoIntKeyed.Add( 174, ComoroFranc );
            _isoIntKeyed.Add( 408, NorthKoreanWon );
            _isoIntKeyed.Add( 410, Won );
            _isoIntKeyed.Add( 414, KuwaitiDinar );
            _isoIntKeyed.Add( 136, CaymanIslandsDollar );
            _isoIntKeyed.Add( 398, Tenge );
            _isoIntKeyed.Add( 418, Kip );
            _isoIntKeyed.Add( 422, LebanesePound );
            _isoIntKeyed.Add( 144, SriLankaRupee );
            _isoIntKeyed.Add( 430, LiberianDollar );
            _isoIntKeyed.Add( 426, Loti );
            _isoIntKeyed.Add( 440, LithuanianLitas );
            _isoIntKeyed.Add( 428, LatvianLats );
            _isoIntKeyed.Add( 434, LibyanDinar );
            _isoIntKeyed.Add( 504, MoroccanDirham );
            _isoIntKeyed.Add( 498, MoldovanLeu );
            _isoIntKeyed.Add( 969, MalagasyAriary );
            _isoIntKeyed.Add( 807, Denar );
            _isoIntKeyed.Add( 104, Kyat );
            _isoIntKeyed.Add( 496, Tugrik );
            _isoIntKeyed.Add( 446, Pataca );
            _isoIntKeyed.Add( 478, Ouguiya );
            _isoIntKeyed.Add( 470, MalteseLira );
            _isoIntKeyed.Add( 480, MauritiusRupee );
            _isoIntKeyed.Add( 462, Rufiyaa );
            _isoIntKeyed.Add( 454, Kwacha );
            _isoIntKeyed.Add( 484, MexicanPeso );
            _isoIntKeyed.Add( 979, MexicanUnidaddeInversion );
            _isoIntKeyed.Add( 458, MalaysianRinggit );
            _isoIntKeyed.Add( 943, Metical );
            _isoIntKeyed.Add( 516, NamibianDollar );
            _isoIntKeyed.Add( 566, Naira );
            _isoIntKeyed.Add( 558, CordobaOro );
            _isoIntKeyed.Add( 578, NorwegianKrone );
            _isoIntKeyed.Add( 524, NepaleseRupee );
            _isoIntKeyed.Add( 554, NewZealandDollar );
            _isoIntKeyed.Add( 512, RialOmani );
            _isoIntKeyed.Add( 590, Balboa );
            _isoIntKeyed.Add( 604, NuevoSol );
            _isoIntKeyed.Add( 598, Kina );
            _isoIntKeyed.Add( 608, PhilippinePeso );
            _isoIntKeyed.Add( 586, PakistanRupee );
            _isoIntKeyed.Add( 985, Zloty );
            _isoIntKeyed.Add( 600, Guarani );
            _isoIntKeyed.Add( 634, QatariRial );
            _isoIntKeyed.Add( 642, OldRomanianLeu );
            _isoIntKeyed.Add( 946, NewLeu );
            _isoIntKeyed.Add( 643, RussianRuble );
            _isoIntKeyed.Add( 646, RwandaFranc );
            _isoIntKeyed.Add( 682, SaudiRiyal );
            _isoIntKeyed.Add( 90, SolomonIslandsDollar );
            _isoIntKeyed.Add( 690, SeychellesRupee );
            _isoIntKeyed.Add( 736, SudaneseDinar );
            _isoIntKeyed.Add( 752, SwedishKrona );
            _isoIntKeyed.Add( 702, SingaporeDollar );
            _isoIntKeyed.Add( 654, SaintHelenaPound );
            _isoIntKeyed.Add( 705, Tolar );
            _isoIntKeyed.Add( 703, SlovakKoruna );
            _isoIntKeyed.Add( 694, Leone );
            _isoIntKeyed.Add( 706, SomaliShilling );
            _isoIntKeyed.Add( 968, SurinamDollar );
            _isoIntKeyed.Add( 678, Dobra );
            _isoIntKeyed.Add( 760, SyrianPound );
            _isoIntKeyed.Add( 748, Lilangeni );
            _isoIntKeyed.Add( 764, Baht );
            _isoIntKeyed.Add( 972, Somoni );
            _isoIntKeyed.Add( 795, Manat );
            _isoIntKeyed.Add( 788, TunisianDinar );
            _isoIntKeyed.Add( 776, Paanga );
            _isoIntKeyed.Add( 949, NewTurkishLira );
            _isoIntKeyed.Add( 780, TrinidadandTobagoDollar );
            _isoIntKeyed.Add( 901, NewTaiwanDollar );
            _isoIntKeyed.Add( 834, TanzanianShilling );
            _isoIntKeyed.Add( 980, Hryvnia );
            _isoIntKeyed.Add( 800, UgandaShilling );
            _isoIntKeyed.Add( 840, USDollar );
            _isoIntKeyed.Add( 858, PesoUruguayo );
            _isoIntKeyed.Add( 860, UzbekistanSom );
            _isoIntKeyed.Add( 862, Venezuelanbolívar );
            _isoIntKeyed.Add( 704, Dong );
            _isoIntKeyed.Add( 548, Vatu );
            _isoIntKeyed.Add( 882, Tala );
            _isoIntKeyed.Add( 950, CFAFrancBEAC );
            _isoIntKeyed.Add( 961, Silver );
            _isoIntKeyed.Add( 959, Gold );
            _isoIntKeyed.Add( 955, EuropeanCompositeUnit );
            _isoIntKeyed.Add( 956, EuropeanMonetaryUnit );
            _isoIntKeyed.Add( 957, EuropeanUnitofAccount9 );
            _isoIntKeyed.Add( 958, EuropeanUnitofAccount17 );
            _isoIntKeyed.Add( 951, EastCaribbeanDollar );
            _isoIntKeyed.Add( 960, SpecialDrawingRights );
            _isoIntKeyed.Add( 000, GoldFranc );
            //_isoIntKeyed.Add( 000, UICFranc );
            _isoIntKeyed.Add( 952, CFAFrancBCEAO );
            _isoIntKeyed.Add( 964, Palladium );
            _isoIntKeyed.Add( 953, CFPfranc );
            _isoIntKeyed.Add( 962, Platinum );
            _isoIntKeyed.Add( 963, CodeReservedForTestingPurposes );
            _isoIntKeyed.Add( 999, Nocurrency );
            _isoIntKeyed.Add( 886, YemeniRial );
            _isoIntKeyed.Add( 710, Rand );
            //_isoIntKeyed.Add( 894, Kwacha );
            _isoIntKeyed.Add( 942, ZimbabweDollar );
            #endregion

            #region CharCode
            _isoThreeLetterKeyed.Add("AED", UnitedArabEmiratesDirham);
            _isoThreeLetterKeyed.Add("AFN", Afghani);
            _isoThreeLetterKeyed.Add("ALL", Lek);
            _isoThreeLetterKeyed.Add("AMD", ArmenianDram);
            _isoThreeLetterKeyed.Add("ANG", NetherlandsAntillianGuilder);
            _isoThreeLetterKeyed.Add("AOA", Kwanza);
            _isoThreeLetterKeyed.Add("ARS", ArgentinePeso);
            _isoThreeLetterKeyed.Add("AUD", AustralianDollar);
            _isoThreeLetterKeyed.Add("AWG", ArubanGuilder);
            _isoThreeLetterKeyed.Add("AZN", AzerbaijanianManat);
            _isoThreeLetterKeyed.Add("BAM", ConvertibleMarks);
            _isoThreeLetterKeyed.Add("BBD", BarbadosDollar);
            _isoThreeLetterKeyed.Add("BDT", Taka);
            _isoThreeLetterKeyed.Add("BGN", BulgarianLev);
            _isoThreeLetterKeyed.Add("BHD", BahrainiDinar);
            _isoThreeLetterKeyed.Add("BIF", BurundianFranc);
            _isoThreeLetterKeyed.Add("BMD", BermudianDollar);
            _isoThreeLetterKeyed.Add("BND", BruneiDollar);
            _isoThreeLetterKeyed.Add("BOB", Boliviano);
            _isoThreeLetterKeyed.Add("BOV", BolivianMvdol);
            _isoThreeLetterKeyed.Add("BRL", BrazilianReal);
            _isoThreeLetterKeyed.Add("BSD", BahamianDollar);
            _isoThreeLetterKeyed.Add("BTN", Ngultrum);
            _isoThreeLetterKeyed.Add("BWP", Pula);
            _isoThreeLetterKeyed.Add("BYR", BelarussianRuble);
            _isoThreeLetterKeyed.Add("BZD", BelizeDollar);
            _isoThreeLetterKeyed.Add("CAD", CanadianDollar);
            _isoThreeLetterKeyed.Add("CDF", FrancCongolais);
            _isoThreeLetterKeyed.Add("CHE", WIREuro);
            _isoThreeLetterKeyed.Add("CHF", SwissFranc);
            _isoThreeLetterKeyed.Add("CHW", WIRFranc);
            _isoThreeLetterKeyed.Add("CLF", Unidadesdeformento);
            _isoThreeLetterKeyed.Add("CLP", ChileanPeso);
            _isoThreeLetterKeyed.Add("CNY", YuanRenminbi);
            _isoThreeLetterKeyed.Add("COP", ColombianPeso);
            _isoThreeLetterKeyed.Add("COU", UnidaddeValorReal);
            _isoThreeLetterKeyed.Add("CRC", CostaRicanColon);
            _isoThreeLetterKeyed.Add("CSD", SerbianDinar);
            _isoThreeLetterKeyed.Add("CUP", CubanPeso);
            _isoThreeLetterKeyed.Add("CVE", CapeVerdeEscudo);
            _isoThreeLetterKeyed.Add("CYP", CyprusPound);
            _isoThreeLetterKeyed.Add("CZK", CzechKoruna);
            _isoThreeLetterKeyed.Add("DJF", DjiboutiFranc);
            _isoThreeLetterKeyed.Add("DKK", DanishKrone);
            _isoThreeLetterKeyed.Add("DOP", DominicanPeso);
            _isoThreeLetterKeyed.Add("DZD", AlgerianDinar);
            _isoThreeLetterKeyed.Add("EEK", Kroon);
            _isoThreeLetterKeyed.Add("EGP", EgyptianPound);
            _isoThreeLetterKeyed.Add("ERN", Nakfa);
            _isoThreeLetterKeyed.Add("ETB", EthiopianBirr);
            _isoThreeLetterKeyed.Add("EUR", Euro);
            _isoThreeLetterKeyed.Add("FJD", FijiDollar);
            _isoThreeLetterKeyed.Add("FKP", FalklandIslandsPound);
            _isoThreeLetterKeyed.Add("GBP", PoundSterling);
            _isoThreeLetterKeyed.Add("GEL", Lari);
            _isoThreeLetterKeyed.Add("GHC", Cedi);
            _isoThreeLetterKeyed.Add("GIP", Gibraltarpound);
            _isoThreeLetterKeyed.Add("GMD", Dalasi);
            _isoThreeLetterKeyed.Add("GNF", GuineaFranc);
            _isoThreeLetterKeyed.Add("GTQ", Quetzal);
            _isoThreeLetterKeyed.Add("GYD", GuyanaDollar);
            _isoThreeLetterKeyed.Add("HKD", HongKongDollar);
            _isoThreeLetterKeyed.Add("HNL", Lempira);
            _isoThreeLetterKeyed.Add("HRK", CroatianKuna);
            _isoThreeLetterKeyed.Add("HTG", HaitiGourde);
            _isoThreeLetterKeyed.Add("HUF", Forint);
            _isoThreeLetterKeyed.Add("IDR", Rupiah);
            _isoThreeLetterKeyed.Add("ILS", NewIsraeliShekel);
            _isoThreeLetterKeyed.Add("INR", IndianRupee);
            _isoThreeLetterKeyed.Add("IQD", IraqiDinar);
            _isoThreeLetterKeyed.Add("IRR", IranianRial);
            _isoThreeLetterKeyed.Add("ISK", IcelandKrona);
            _isoThreeLetterKeyed.Add("JMD", JamaicanDollar);
            _isoThreeLetterKeyed.Add("JOD", JordanianDinar);
            _isoThreeLetterKeyed.Add("JPY", Japaneseyen);
            _isoThreeLetterKeyed.Add("KES", KenyanShilling);
            _isoThreeLetterKeyed.Add("KGS", Som);
            _isoThreeLetterKeyed.Add("KHR", Riel);
            _isoThreeLetterKeyed.Add("KMF", ComoroFranc);
            _isoThreeLetterKeyed.Add("KPW", NorthKoreanWon);
            _isoThreeLetterKeyed.Add("KRW", Won);
            _isoThreeLetterKeyed.Add("KWD", KuwaitiDinar);
            _isoThreeLetterKeyed.Add("KYD", CaymanIslandsDollar);
            _isoThreeLetterKeyed.Add("KZT", Tenge);
            _isoThreeLetterKeyed.Add("LAK", Kip);
            _isoThreeLetterKeyed.Add("LBP", LebanesePound);
            _isoThreeLetterKeyed.Add("LKR", SriLankaRupee);
            _isoThreeLetterKeyed.Add("LRD", LiberianDollar);
            _isoThreeLetterKeyed.Add("LSL", Loti);
            _isoThreeLetterKeyed.Add("LTL", LithuanianLitas);
            _isoThreeLetterKeyed.Add("LVL", LatvianLats);
            _isoThreeLetterKeyed.Add("LYD", LibyanDinar);
            _isoThreeLetterKeyed.Add("MAD", MoroccanDirham);
            _isoThreeLetterKeyed.Add("MDL", MoldovanLeu);
            _isoThreeLetterKeyed.Add("MGA", MalagasyAriary);
            _isoThreeLetterKeyed.Add("MKD", Denar);
            _isoThreeLetterKeyed.Add("MMK", Kyat);
            _isoThreeLetterKeyed.Add("MNT", Tugrik);
            _isoThreeLetterKeyed.Add("MOP", Pataca);
            _isoThreeLetterKeyed.Add("MRO", Ouguiya);
            _isoThreeLetterKeyed.Add("MTL", MalteseLira);
            _isoThreeLetterKeyed.Add("MUR", MauritiusRupee);
            _isoThreeLetterKeyed.Add("MVR", Rufiyaa);
            _isoThreeLetterKeyed.Add("MWK", Kwacha);
            _isoThreeLetterKeyed.Add("MXN", MexicanPeso);
            _isoThreeLetterKeyed.Add("MXV", MexicanUnidaddeInversion);
            _isoThreeLetterKeyed.Add("MYR", MalaysianRinggit);
            _isoThreeLetterKeyed.Add("MZN", Metical);
            _isoThreeLetterKeyed.Add("NAD", NamibianDollar);
            _isoThreeLetterKeyed.Add("NGN", Naira);
            _isoThreeLetterKeyed.Add("NIO", CordobaOro);
            _isoThreeLetterKeyed.Add("NOK", NorwegianKrone);
            _isoThreeLetterKeyed.Add("NPR", NepaleseRupee);
            _isoThreeLetterKeyed.Add("NZD", NewZealandDollar);
            _isoThreeLetterKeyed.Add("OMR", RialOmani);
            _isoThreeLetterKeyed.Add("PAB", Balboa);
            _isoThreeLetterKeyed.Add("PEN", NuevoSol);
            _isoThreeLetterKeyed.Add("PGK", Kina);
            _isoThreeLetterKeyed.Add("PHP", PhilippinePeso);
            _isoThreeLetterKeyed.Add("PKR", PakistanRupee);
            _isoThreeLetterKeyed.Add("PLN", Zloty);
            _isoThreeLetterKeyed.Add("PYG", Guarani);
            _isoThreeLetterKeyed.Add("QAR", QatariRial);
            _isoThreeLetterKeyed.Add("ROL", OldRomanianLeu);
            _isoThreeLetterKeyed.Add("RON", NewLeu);
            _isoThreeLetterKeyed.Add("RUB", RussianRuble);
            _isoThreeLetterKeyed.Add("RWF", RwandaFranc);
            _isoThreeLetterKeyed.Add("SAR", SaudiRiyal);
            _isoThreeLetterKeyed.Add("SBD", SolomonIslandsDollar);
            _isoThreeLetterKeyed.Add("SCR", SeychellesRupee);
            _isoThreeLetterKeyed.Add("SDD", SudaneseDinar);
            _isoThreeLetterKeyed.Add("SEK", SwedishKrona);
            _isoThreeLetterKeyed.Add("SGD", SingaporeDollar);
            _isoThreeLetterKeyed.Add("SHP", SaintHelenaPound);
            _isoThreeLetterKeyed.Add("SIT", Tolar);
            _isoThreeLetterKeyed.Add("SKK", SlovakKoruna);
            _isoThreeLetterKeyed.Add("SLL", Leone);
            _isoThreeLetterKeyed.Add("SOS", SomaliShilling);
            _isoThreeLetterKeyed.Add("SRD", SurinamDollar);
            _isoThreeLetterKeyed.Add("STD", Dobra);
            _isoThreeLetterKeyed.Add("SYP", SyrianPound);
            _isoThreeLetterKeyed.Add("SZL", Lilangeni);
            _isoThreeLetterKeyed.Add("THB", Baht);
            _isoThreeLetterKeyed.Add("TJS", Somoni);
            _isoThreeLetterKeyed.Add("TMM", Manat);
            _isoThreeLetterKeyed.Add("TND", TunisianDinar);
            _isoThreeLetterKeyed.Add("TOP", Paanga);
            _isoThreeLetterKeyed.Add("TRY", NewTurkishLira);
            _isoThreeLetterKeyed.Add("TTD", TrinidadandTobagoDollar);
            _isoThreeLetterKeyed.Add("TWD", NewTaiwanDollar);
            _isoThreeLetterKeyed.Add("TZS", TanzanianShilling);
            _isoThreeLetterKeyed.Add("UAH", Hryvnia);
            _isoThreeLetterKeyed.Add("UGX", UgandaShilling);
            _isoThreeLetterKeyed.Add("USD", USDollar);
            _isoThreeLetterKeyed.Add("UYU", PesoUruguayo);
            _isoThreeLetterKeyed.Add("UZS", UzbekistanSom);
            _isoThreeLetterKeyed.Add("VEB", Venezuelanbolívar);
            _isoThreeLetterKeyed.Add("VND", Dong);
            _isoThreeLetterKeyed.Add("VUV", Vatu);
            _isoThreeLetterKeyed.Add("WST", Tala);
            _isoThreeLetterKeyed.Add("XAF", CFAFrancBEAC);
            _isoThreeLetterKeyed.Add("XAG", Silver);
            _isoThreeLetterKeyed.Add("XAU", Gold);
            _isoThreeLetterKeyed.Add("XBA", EuropeanCompositeUnit);
            _isoThreeLetterKeyed.Add("XBB", EuropeanMonetaryUnit);
            _isoThreeLetterKeyed.Add("XBC", EuropeanUnitofAccount9);
            _isoThreeLetterKeyed.Add("XBD", EuropeanUnitofAccount17);
            _isoThreeLetterKeyed.Add("XCD", EastCaribbeanDollar);
            _isoThreeLetterKeyed.Add("XDR", SpecialDrawingRights);
            _isoThreeLetterKeyed.Add("XFO", GoldFranc);
            _isoThreeLetterKeyed.Add("XFU", UICFranc);
            _isoThreeLetterKeyed.Add("XOF", CFAFrancBCEAO);
            _isoThreeLetterKeyed.Add("XPD", Palladium);
            _isoThreeLetterKeyed.Add("XPF", CFPfranc);
            _isoThreeLetterKeyed.Add("XPT", Platinum);
            _isoThreeLetterKeyed.Add("XTS", CodeReservedForTestingPurposes);
            _isoThreeLetterKeyed.Add("XXX", Nocurrency);
            _isoThreeLetterKeyed.Add("YER", YemeniRial);
            _isoThreeLetterKeyed.Add("ZAR", Rand);
            //_isoThreeLetterKeyed.Add( "ZMK", Kwacha );
            _isoThreeLetterKeyed.Add("ZWN", ZimbabweDollar);
            #endregion
        }

        public static readonly MoneyCurrency  UnitedArabEmiratesDirham = new MoneyCurrency(784, "AED", "United Arab Emirates Dirham");
        public static readonly MoneyCurrency  Afghani = new MoneyCurrency(971, "AFN", "Afghani");
        public static readonly MoneyCurrency  Lek = new MoneyCurrency(8, "ALL", "Lek");
        public static readonly MoneyCurrency  ArmenianDram = new MoneyCurrency(51, "AMD", "Armenian Dram");
        public static readonly MoneyCurrency  NetherlandsAntillianGuilder = new MoneyCurrency(532, "ANG", "Netherlands Antillian Guilder");
        public static readonly MoneyCurrency  Kwanza = new MoneyCurrency(973, "AOA", "Kwanza");
        public static readonly MoneyCurrency  ArgentinePeso = new MoneyCurrency(32, "ARS", "Argentine Peso");
        public static readonly MoneyCurrency  AustralianDollar = new MoneyCurrency(36, "AUD", "Australian Dollar", "AU$");
        public static readonly MoneyCurrency  ArubanGuilder = new MoneyCurrency(533, "AWG", "Aruban Guilder");
        public static readonly MoneyCurrency  AzerbaijanianManat = new MoneyCurrency(944, "AZN", "Azerbaijanian Manat");
        public static readonly MoneyCurrency  ConvertibleMarks = new MoneyCurrency(977, "BAM", "Convertible Marks");
        public static readonly MoneyCurrency  BarbadosDollar = new MoneyCurrency(52, "BBD", "Barbados Dollar");
        public static readonly MoneyCurrency  Taka = new MoneyCurrency(50, "BDT", "Taka");
        public static readonly MoneyCurrency  BulgarianLev = new MoneyCurrency(975, "BGN", "Bulgarian Lev");
        public static readonly MoneyCurrency  BahrainiDinar = new MoneyCurrency(48, "BHD", "Bahraini Dinar");
        public static readonly MoneyCurrency  BurundianFranc = new MoneyCurrency(108, "BIF", "Burundian Franc");
        public static readonly MoneyCurrency  BermudianDollar = new MoneyCurrency(60, "BMD", "Bermudian Dollar (customarily known as Bermuda Dollar)");
        public static readonly MoneyCurrency  BruneiDollar = new MoneyCurrency(96, "BND", "Brunei Dollar");
        public static readonly MoneyCurrency  Boliviano = new MoneyCurrency(68, "BOB", "Boliviano");
        public static readonly MoneyCurrency  BolivianMvdol = new MoneyCurrency(984, "BOV", "Bolivian Mvdol (Funds code)");
        public static readonly MoneyCurrency  BrazilianReal = new MoneyCurrency(986, "BRL", "Brazilian Real");
        public static readonly MoneyCurrency  BahamianDollar = new MoneyCurrency(44, "BSD", "Bahamian Dollar");
        public static readonly MoneyCurrency  Ngultrum = new MoneyCurrency(64, "BTN", "Ngultrum");
        public static readonly MoneyCurrency  Pula = new MoneyCurrency(72, "BWP", "Pula");
        public static readonly MoneyCurrency  BelarussianRuble = new MoneyCurrency(974, "BYR", "Belarussian Ruble");
        public static readonly MoneyCurrency  BelizeDollar = new MoneyCurrency(84, "BZD", "Belize Dollar");
        public static readonly MoneyCurrency  CanadianDollar = new MoneyCurrency(124, "CAD", "Canadian Dollar");
        public static readonly MoneyCurrency  FrancCongolais = new MoneyCurrency(976, "CDF", "Franc Congolais");
        public static readonly MoneyCurrency  WIREuro = new MoneyCurrency(947, "CHE", "WIR Euro (complementary currency)");
        public static readonly MoneyCurrency  SwissFranc = new MoneyCurrency(756, "CHF", "Swiss Franc");
        public static readonly MoneyCurrency  WIRFranc = new MoneyCurrency(948, "CHW", "WIR Franc (complementary currency)");
        public static readonly MoneyCurrency  Unidadesdeformento = new MoneyCurrency(990, "CLF", "Unidades de formento (Funds code)");
        public static readonly MoneyCurrency  ChileanPeso = new MoneyCurrency(152, "CLP", "Chilean Peso");
        public static readonly MoneyCurrency  YuanRenminbi = new MoneyCurrency(156, "CNY", "Yuan Renminbi");
        public static readonly MoneyCurrency  ColombianPeso = new MoneyCurrency(170, "COP", "Colombian Peso");
        public static readonly MoneyCurrency  UnidaddeValorReal = new MoneyCurrency(970, "COU", "Unidad de Valor Real");
        public static readonly MoneyCurrency  CostaRicanColon = new MoneyCurrency(188, "CRC", "Costa Rican Colon");
        public static readonly MoneyCurrency  SerbianDinar = new MoneyCurrency(891, "CSD", "Serbian Dinar");
        public static readonly MoneyCurrency  CubanPeso = new MoneyCurrency(192, "CUP", "Cuban Peso");
        public static readonly MoneyCurrency  CapeVerdeEscudo = new MoneyCurrency(132, "CVE", "Cape Verde Escudo");
        public static readonly MoneyCurrency  CyprusPound = new MoneyCurrency(196, "CYP", "Cyprus Pound");
        public static readonly MoneyCurrency  CzechKoruna = new MoneyCurrency(203, "CZK", "Czech Koruna");
        public static readonly MoneyCurrency  DjiboutiFranc = new MoneyCurrency(262, "DJF", "Djibouti Franc");
        public static readonly MoneyCurrency  DanishKrone = new MoneyCurrency(208, "DKK", "Danish Krone");
        public static readonly MoneyCurrency  DominicanPeso = new MoneyCurrency(214, "DOP", "Dominican Peso");
        public static readonly MoneyCurrency  AlgerianDinar = new MoneyCurrency(12, "DZD", "Algerian Dinar");
        public static readonly MoneyCurrency  Kroon = new MoneyCurrency(233, "EEK", "Kroon");
        public static readonly MoneyCurrency  EgyptianPound = new MoneyCurrency(818, "EGP", "Egyptian Pound");
        public static readonly MoneyCurrency  Nakfa = new MoneyCurrency(232, "ERN", "Nakfa");
        public static readonly MoneyCurrency  EthiopianBirr = new MoneyCurrency(230, "ETB", "Ethiopian Birr");
        public static readonly MoneyCurrency  Euro = new MoneyCurrency(978, "EUR", "Euro", "€");
        public static readonly MoneyCurrency  FijiDollar = new MoneyCurrency(242, "FJD", "Fiji Dollar");
        public static readonly MoneyCurrency  FalklandIslandsPound = new MoneyCurrency(238, "FKP", "Falkland Islands Pound");
        public static readonly MoneyCurrency  PoundSterling = new MoneyCurrency(826, "GBP", "Pound Sterling", "£");
        public static readonly MoneyCurrency  Lari = new MoneyCurrency(981, "GEL", "Lari");
        public static readonly MoneyCurrency  Cedi = new MoneyCurrency(288, "GHC", "Cedi");
        public static readonly MoneyCurrency  Gibraltarpound = new MoneyCurrency(292, "GIP", "Gibraltar pound");
        public static readonly MoneyCurrency  Dalasi = new MoneyCurrency(270, "GMD", "Dalasi");
        public static readonly MoneyCurrency  GuineaFranc = new MoneyCurrency(324, "GNF", "Guinea Franc");
        public static readonly MoneyCurrency  Quetzal = new MoneyCurrency(320, "GTQ", "Quetzal");
        public static readonly MoneyCurrency  GuyanaDollar = new MoneyCurrency(328, "GYD", "Guyana Dollar");
        public static readonly MoneyCurrency  HongKongDollar = new MoneyCurrency(344, "HKD", "Hong Kong Dollar");
        public static readonly MoneyCurrency  Lempira = new MoneyCurrency(340, "HNL", "Lempira");
        public static readonly MoneyCurrency  CroatianKuna = new MoneyCurrency(191, "HRK", "Croatian Kuna");
        public static readonly MoneyCurrency  HaitiGourde = new MoneyCurrency(332, "HTG", "Haiti Gourde");
        public static readonly MoneyCurrency  Forint = new MoneyCurrency(348, "HUF", "Forint");
        public static readonly MoneyCurrency  Rupiah = new MoneyCurrency(360, "IDR", "Rupiah");
        public static readonly MoneyCurrency  NewIsraeliShekel = new MoneyCurrency(376, "ILS", "New Israeli Shekel");
        public static readonly MoneyCurrency  IndianRupee = new MoneyCurrency(356, "INR", "Indian Rupee");
        public static readonly MoneyCurrency  IraqiDinar = new MoneyCurrency(368, "IQD", "Iraqi Dinar");
        public static readonly MoneyCurrency  IranianRial = new MoneyCurrency(364, "IRR", "Iranian Rial");
        public static readonly MoneyCurrency  IcelandKrona = new MoneyCurrency(352, "ISK", "Iceland Krona");
        public static readonly MoneyCurrency  JamaicanDollar = new MoneyCurrency(388, "JMD", "Jamaican Dollar");
        public static readonly MoneyCurrency  JordanianDinar = new MoneyCurrency(400, "JOD", "Jordanian Dinar");
        public static readonly MoneyCurrency  Japaneseyen = new MoneyCurrency(392, "JPY", "Japanese yen", "¥");
        public static readonly MoneyCurrency  KenyanShilling = new MoneyCurrency(404, "KES", "Kenyan Shilling");
        public static readonly MoneyCurrency  Som = new MoneyCurrency(417, "KGS", "Som");
        public static readonly MoneyCurrency  Riel = new MoneyCurrency(116, "KHR", "Riel");
        public static readonly MoneyCurrency  ComoroFranc = new MoneyCurrency(174, "KMF", "Comoro Franc");
        public static readonly MoneyCurrency  NorthKoreanWon = new MoneyCurrency(408, "KPW", "North Korean Won", "NK₩");
        public static readonly MoneyCurrency  Won = new MoneyCurrency(410, "KRW", "Won", "₩");
        public static readonly MoneyCurrency  KuwaitiDinar = new MoneyCurrency(414, "KWD", "Kuwaiti Dinar");
        public static readonly MoneyCurrency  CaymanIslandsDollar = new MoneyCurrency(136, "KYD", "Cayman Islands Dollar");
        public static readonly MoneyCurrency  Tenge = new MoneyCurrency(398, "KZT", "Tenge");
        public static readonly MoneyCurrency  Kip = new MoneyCurrency(418, "LAK", "Kip");
        public static readonly MoneyCurrency  LebanesePound = new MoneyCurrency(422, "LBP", "Lebanese Pound");
        public static readonly MoneyCurrency  SriLankaRupee = new MoneyCurrency(144, "LKR", "Sri Lanka Rupee");
        public static readonly MoneyCurrency  LiberianDollar = new MoneyCurrency(430, "LRD", "Liberian Dollar");
        public static readonly MoneyCurrency  Loti = new MoneyCurrency(426, "LSL", "Loti");
        public static readonly MoneyCurrency  LithuanianLitas = new MoneyCurrency(440, "LTL", "Lithuanian Litas");
        public static readonly MoneyCurrency  LatvianLats = new MoneyCurrency(428, "LVL", "Latvian Lats");
        public static readonly MoneyCurrency  LibyanDinar = new MoneyCurrency(434, "LYD", "Libyan Dinar");
        public static readonly MoneyCurrency  MoroccanDirham = new MoneyCurrency(504, "MAD", "Moroccan Dirham");
        public static readonly MoneyCurrency  MoldovanLeu = new MoneyCurrency(498, "MDL", "Moldovan Leu");
        public static readonly MoneyCurrency  MalagasyAriary = new MoneyCurrency(969, "MGA", "Malagasy Ariary");
        public static readonly MoneyCurrency  Denar = new MoneyCurrency(807, "MKD", "Denar");
        public static readonly MoneyCurrency  Kyat = new MoneyCurrency(104, "MMK", "Kyat");
        public static readonly MoneyCurrency  Tugrik = new MoneyCurrency(496, "MNT", "Tugrik");
        public static readonly MoneyCurrency  Pataca = new MoneyCurrency(446, "MOP", "Pataca");
        public static readonly MoneyCurrency  Ouguiya = new MoneyCurrency(478, "MRO", "Ouguiya");
        public static readonly MoneyCurrency  MalteseLira = new MoneyCurrency(470, "MTL", "Maltese Lira");
        public static readonly MoneyCurrency  MauritiusRupee = new MoneyCurrency(480, "MUR", "Mauritius Rupee");
        public static readonly MoneyCurrency  Rufiyaa = new MoneyCurrency(462, "MVR", "Rufiyaa");
        public static readonly MoneyCurrency  Kwacha = new MoneyCurrency(454, "MWK", "Kwacha");
        public static readonly MoneyCurrency  MexicanPeso = new MoneyCurrency(484, "MXN", "Mexican Peso");
        public static readonly MoneyCurrency  MexicanUnidaddeInversion = new MoneyCurrency(979, "MXV", "Mexican Unidad de Inversion (UDI) (Funds code) (Mexico)");
        public static readonly MoneyCurrency  MalaysianRinggit = new MoneyCurrency(458, "MYR", "Malaysian Ringgit");
        public static readonly MoneyCurrency  Metical = new MoneyCurrency(943, "MZN", "Metical");
        public static readonly MoneyCurrency  NamibianDollar = new MoneyCurrency(516, "NAD", "Namibian Dollar");
        public static readonly MoneyCurrency  Naira = new MoneyCurrency(566, "NGN", "Naira", "₦");
        public static readonly MoneyCurrency  CordobaOro = new MoneyCurrency(558, "NIO", "Cordoba Oro");
        public static readonly MoneyCurrency  NorwegianKrone = new MoneyCurrency(578, "NOK", "Norwegian Krone");
        public static readonly MoneyCurrency  NepaleseRupee = new MoneyCurrency(524, "NPR", "Nepalese Rupee");
        public static readonly MoneyCurrency  NewZealandDollar = new MoneyCurrency(554, "NZD", "New Zealand Dollar");
        public static readonly MoneyCurrency  RialOmani = new MoneyCurrency(512, "OMR", "Rial Omani");
        public static readonly MoneyCurrency  Balboa = new MoneyCurrency(590, "PAB", "Balboa");
        public static readonly MoneyCurrency  NuevoSol = new MoneyCurrency(604, "PEN", "Nuevo Sol");
        public static readonly MoneyCurrency  Kina = new MoneyCurrency(598, "PGK", "Kina");
        public static readonly MoneyCurrency  PhilippinePeso = new MoneyCurrency(608, "PHP", "Philippine Peso");
        public static readonly MoneyCurrency  PakistanRupee = new MoneyCurrency(586, "PKR", "Pakistan Rupee");
        public static readonly MoneyCurrency  Zloty = new MoneyCurrency(985, "PLN", "Zloty");
        public static readonly MoneyCurrency  Guarani = new MoneyCurrency(600, "PYG", "Guarani");
        public static readonly MoneyCurrency  QatariRial = new MoneyCurrency(634, "QAR", "Qatari Rial");
        public static readonly MoneyCurrency  OldRomanianLeu = new MoneyCurrency(642, "ROL", "Old Romanian Leu");
        public static readonly MoneyCurrency  NewLeu = new MoneyCurrency(946, "RON", "New Leu");
        public static readonly MoneyCurrency  RussianRuble = new MoneyCurrency(643, "RUB", "Russian Ruble");
        public static readonly MoneyCurrency  RwandaFranc = new MoneyCurrency(646, "RWF", "Rwanda Franc");
        public static readonly MoneyCurrency  SaudiRiyal = new MoneyCurrency(682, "SAR", "Saudi Riyal");
        public static readonly MoneyCurrency  SolomonIslandsDollar = new MoneyCurrency(90, "SBD", "Solomon Islands Dollar");
        public static readonly MoneyCurrency  SeychellesRupee = new MoneyCurrency(690, "SCR", "Seychelles Rupee");
        public static readonly MoneyCurrency  SudaneseDinar = new MoneyCurrency(736, "SDD", "Sudanese Dinar");
        public static readonly MoneyCurrency  SwedishKrona = new MoneyCurrency(752, "SEK", "Swedish Krona");
        public static readonly MoneyCurrency  SingaporeDollar = new MoneyCurrency(702, "SGD", "Singapore Dollar");
        public static readonly MoneyCurrency  SaintHelenaPound = new MoneyCurrency(654, "SHP", "Saint Helena Pound");
        public static readonly MoneyCurrency  Tolar = new MoneyCurrency(705, "SIT", "Tolar");
        public static readonly MoneyCurrency  SlovakKoruna = new MoneyCurrency(703, "SKK", "Slovak Koruna");
        public static readonly MoneyCurrency  Leone = new MoneyCurrency(694, "SLL", "Leone");
        public static readonly MoneyCurrency  SomaliShilling = new MoneyCurrency(706, "SOS", "Somali Shilling");
        public static readonly MoneyCurrency  SurinamDollar = new MoneyCurrency(968, "SRD", "Surinam Dollar");
        public static readonly MoneyCurrency  Dobra = new MoneyCurrency(678, "STD", "Dobra");
        public static readonly MoneyCurrency  SyrianPound = new MoneyCurrency(760, "SYP", "Syrian Pound");
        public static readonly MoneyCurrency  Lilangeni = new MoneyCurrency(748, "SZL", "Lilangeni");
        public static readonly MoneyCurrency  Baht = new MoneyCurrency(764, "THB", "Baht");
        public static readonly MoneyCurrency  Somoni = new MoneyCurrency(972, "TJS", "Somoni");
        public static readonly MoneyCurrency  Manat = new MoneyCurrency(795, "TMM", "Manat");
        public static readonly MoneyCurrency  TunisianDinar = new MoneyCurrency(788, "TND", "Tunisian Dinar");
        public static readonly MoneyCurrency  Paanga = new MoneyCurrency(776, "TOP", "Pa'anga");
        public static readonly MoneyCurrency  NewTurkishLira = new MoneyCurrency(949, "TRY", "New Turkish Lira", "₤");
        public static readonly MoneyCurrency  TrinidadandTobagoDollar = new MoneyCurrency(780, "TTD", "Trinidad and Tobago Dollar");
        public static readonly MoneyCurrency  NewTaiwanDollar = new MoneyCurrency(901, "TWD", "New Taiwan Dollar");
        public static readonly MoneyCurrency  TanzanianShilling = new MoneyCurrency(834, "TZS", "Tanzanian Shilling");
        public static readonly MoneyCurrency  Hryvnia = new MoneyCurrency(980, "UAH", "Hryvnia");
        public static readonly MoneyCurrency  UgandaShilling = new MoneyCurrency(800, "UGX", "Uganda Shilling");
        public static readonly MoneyCurrency  USDollar = new MoneyCurrency(840, "USD", "US Dollar", "US$");
        public static readonly MoneyCurrency  PesoUruguayo = new MoneyCurrency(858, "UYU", "Peso Uruguayo");
        public static readonly MoneyCurrency  UzbekistanSom = new MoneyCurrency(860, "UZS", "Uzbekistan Som");
        public static readonly MoneyCurrency  Venezuelanbolívar = new MoneyCurrency(862, "VEB", "Venezuelan bolívar");
        public static readonly MoneyCurrency  Dong = new MoneyCurrency(704, "VND", "Dong");
        public static readonly MoneyCurrency  Vatu = new MoneyCurrency(548, "VUV", "Vatu");
        public static readonly MoneyCurrency  Tala = new MoneyCurrency(882, "WST", "Tala");
        public static readonly MoneyCurrency  CFAFrancBEAC = new MoneyCurrency(950, "XAF", "CFA Franc BEAC");
        public static readonly MoneyCurrency  Silver = new MoneyCurrency(961, "XAG", "Silver (one Troy ounce)");
        public static readonly MoneyCurrency  Gold = new MoneyCurrency(959, "XAU", "Gold (one Troy ounce)");
        public static readonly MoneyCurrency  EuropeanCompositeUnit = new MoneyCurrency(955, "XBA", "European Composite Unit (EURCO) (Bonds market unit)");
        public static readonly MoneyCurrency  EuropeanMonetaryUnit = new MoneyCurrency(956, "XBB", "European Monetary Unit (E.M.U.-6) (Bonds market unit)");
        public static readonly MoneyCurrency  EuropeanUnitofAccount9 = new MoneyCurrency(957, "XBC", "European Unit of Account 9 (E.U.A.-9) (Bonds market unit)");
        public static readonly MoneyCurrency  EuropeanUnitofAccount17 = new MoneyCurrency(958, "XBD", "European Unit of Account 17 (E.U.A.-17) (Bonds market unit)");
        public static readonly MoneyCurrency  EastCaribbeanDollar = new MoneyCurrency(951, "XCD", "East Caribbean Dollar");
        public static readonly MoneyCurrency  SpecialDrawingRights = new MoneyCurrency(960, "XDR", "Special Drawing Rights");
        public static readonly MoneyCurrency  GoldFranc = new MoneyCurrency(0, "XFO", "Gold-Franc (Special settlement currency)");
        public static readonly MoneyCurrency  UICFranc = new MoneyCurrency(0, "XFU", "UIC Franc (Special settlement currency)");
        public static readonly MoneyCurrency  CFAFrancBCEAO = new MoneyCurrency(952, "XOF", "CFA Franc BCEAO");
        public static readonly MoneyCurrency  Palladium = new MoneyCurrency(964, "XPD", "Palladium (one Troy ounce)");
        public static readonly MoneyCurrency  CFPfranc = new MoneyCurrency(953, "XPF", "CFP franc");
        public static readonly MoneyCurrency  Platinum = new MoneyCurrency(962, "XPT", "Platinum (one Troy ounce)");
        public static readonly MoneyCurrency  CodeReservedForTestingPurposes = new MoneyCurrency(963, "XTS", "Code Reserved For Testing Purposes");
        public static readonly MoneyCurrency  Nocurrency = new MoneyCurrency(999, "XXX", "No currency");
        public static readonly MoneyCurrency  YemeniRial = new MoneyCurrency(886, "YER", "Yemeni Rial");
        public static readonly MoneyCurrency  Rand = new MoneyCurrency(710, "ZAR", "Rand");
        //public static readonly MoneyCurrency  Kwacha = new MoneyCurrency(894, "ZMK", "Kwacha");
        public static readonly MoneyCurrency  ZimbabweDollar = new MoneyCurrency(942, "ZWN", "Zimbabwe Dollar");
        #endregion

        /// <summary>
        /// Looks up a currency by the ISO standard code number.
        /// </summary>
        /// <param name="isoCode">The ISO code of the currency to look up.</param>
        /// <returns>The <see cref="MoneyCurrency"/> for the money.</returns>
        public static MoneyCurrency GetCurrency(int isoCode)
        {
            MoneyCurrency currency = MoneyCurrency.Empty;
            if (_isoIntKeyed.TryGetValue(isoCode, out currency))
                return currency;
            else
                throw new ArgumentException("The specificed currency code does not exist.");
        }

        /// <summary>
        /// Looks up a currency by the ISO standard three-letter code.
        /// </summary>
        /// <param name="code">The ISO code of the currency to look up.</param>
        /// <returns>The <see cref="MoneyCurrency"/> for the money.</returns>
        public static MoneyCurrency GetCurrency(string code)
        {
            if (code == null)
                throw new ArgumentNullException("code");

            if (code.Length != 3)
                throw new ArgumentException("A currency code must be three letters in length.");

            MoneyCurrency currency = MoneyCurrency.Empty;
            if (_isoThreeLetterKeyed.TryGetValue(code.ToUpper(), out currency))
                return currency;
            else
                throw new ArgumentException("The specificed currency code does not exist.");
        }

        /// <summary>
        /// Looks up a currency by the ISO standard three-letter code.
        /// </summary>
        /// <param name="code">The ISO code of the currency to look up.</param>
        /// <param name="value">The currency value for the code.</param>
        /// <returns>True if the currency exists, else false</returns>
        public static bool TryGetCurrency(string code, out MoneyCurrency value)
        {
            if (code == null)
                throw new ArgumentNullException("code");

            if (code.Length != 3)
                throw new ArgumentException("A currency code must be three letters in length.");

            value = MoneyCurrency.Empty;
            return _isoThreeLetterKeyed.TryGetValue(code.ToUpper(), out value);
        }

        /// <summary>
        /// Gets a list of all the currencies defined.
        /// </summary>
        /// <returns>An array of all currencies, sorted
        /// by code.</returns>
        public static MoneyCurrency[] GetCurrencies()
        {
            SortedList<string, MoneyCurrency> currencies = new SortedList<string, MoneyCurrency>();
            foreach (MoneyCurrency currency in _isoThreeLetterKeyed.Values)
                currencies.Add(currency.ThreeLetterIsoName, currency);

            MoneyCurrency[] returnValues = new MoneyCurrency[currencies.Count];
            currencies.Values.CopyTo(returnValues, 0);
            return returnValues;
        }
    }
}
